//
// Created by Tony on 2024/7/9.
//

#include "MethodRef.h"
#include "../Class.h"

namespace RtCode {

std::shared_ptr<Method> MethodRef::resolvedMethod() {
    auto method = mMethod.lock();
    if (method != nullptr) {
        return method;
    }

    shared_ptr<Class> clazz = resolvedClass();
    method = clazz->getMethod(memberName());
    mMethod = method;
    return method;
}

} // namespace RtCode
